package com.wl.application.context;

import com.wl.application.entity.LoginUser;
import com.wl.application.entity.UserToken;

/**
 * @author wl
 * @version 1.0
 * @date 2022/6/17
 * @description:
 */
public class LoginLocalThread {


    private static final ThreadLocal<LoginUser> THREAD_LOCAL = new ThreadLocal<>();


    /**
     * 存储数据
     */
    public static void setLocal(LoginUser u) {
        THREAD_LOCAL.set(u);
    }

    /**
     * 取出数据
     */
    public static LoginUser getLocal() {
        return THREAD_LOCAL.get();
    }

    /**
     * 清空数据
     */
    public static void remove(){
        THREAD_LOCAL.remove();
    }

}
